import fetch from '@/utils/request';

const API_ACCOUNT_URL = '/api/user/finance/account';
/**
 * 银行卡账户API对象
 * @module AccontApi
 */
const AccontApi = {
	/**
	 * @function query
	 * @description 查询银行卡对象
	 */
	query: () => fetch.request({
		url: `${API_ACCOUNT_URL}/query`,
		method: 'POST',
	}),
	/**
	 * @function save
	 * @description 添加银行卡
	 * @param  {Object} address 银行卡对象
	 */
	save: (account) => fetch.request({
		url: `${API_ACCOUNT_URL}/save`,
		method: 'POST',
		data: {
			account: account,
		},
	}),
	/**
	 * @function delete
	 * @description 删除银行卡
	 * @param  {String} id 银行卡对象id
	 */
	delete: (id) => fetch.request({
		url: `${API_ACCOUNT_URL}/delete`,
		method: 'POST',
		data: {
			id: id,
		},
	}),
}
export default AccontApi;